{% set clazz = "orders" %}
{% set title = "兑换记录" %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" type="text/css" href="{{ '/static/css/integral.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
    <header class="bar bar-header">
      {{ macro.back() }}
      <h1 class="title">{{ title }}</h1>
    </header>
  {% endif %}
  <section>
    {% if list.length %}
      <div id="orders" class="list hspace">
      {% for item in list %}
        <a class="item" href="/integral/order/{{ item.id }}">
          <div class="avatar">
            <img class="round" src="{{ item.coverImg|thumb(80, 80) }}" ui-mode="80px">
          </div>
          <span class="text">
            {{ item.goodsName }}
            <div class="brief"><span class="text-orange">{{ item.consumeIntegral }}积分</span></div>
          </span>
          <i class="icon text-gray">&#xe61a;</i>
        </a>
      {% endfor %}
      </div>
    {% else %}
      <div class="plate">
        <div class="draw">
          <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
          <h4 class="title">你还还没兑换记录哦</h4>
          <div class="interact">
            <a class="button warning" href="/integral">去看看</a>
          </div>
        </div>
      </div>
    {% endif %}
  </section>
  {% raw %}
    <script id="ordersTempl" type="text/swig-template">
     {% for item in list %}
        <a class="item" href="/integral/order/{{ item.id }}">
          <div class="avatar">
            <img class="round" src="{{ item.coverImg|thumb(80, 80) }}" ui-mode="80px">
          </div>
          <span class="text">
            {{ item.goodsName }}
            <div class="brief"><span class="text-orange">{{ item.consumeIntegral }}积分</span></div>
          </span>
          <i class="icon text-gray">&#xe61a;</i>
        </a>
      {% endfor %}
    </script>
  {% endraw %}
{% endblock %}
{% block script %}
  {% parent %}
  <script src="{{ '/static/js/integral.js'|version }}"></script>
{% endblock %}